import http from "@/utils/request"


export const addCategory = (categoryName:any, categoryImgurl:any) => http.post('/category/addCategory', {
    categoryName,
    categoryImgurl
})

//上传类目图片

// export const uploadCategoryImg = () => http.post('/students/uploadStuAvatar')

//删除类目

export let deleteCategory = (category_id:any) => http.get('/category/delCategory', {
    params: {
        category_id,
    }
})
export let getProductlistApi=(productid?:string,categoryid?:string)=>{
    return http.get('/product/get_product',{
        params:{
            productid:productid,
            categoryid:categoryid
        }
    })
}
// 增加商品
export let addProductApi=(category_id:string,productName:string,price:Number,description:string,inventory:number,imageUrl:string)=>http.post('/product/add_product',{
    category_id,
    productName,
    price,
    description,
    inventory,
    imageUrl
})
export let delProduct=(product_id:string)=>http.get("/product/del_product",{
    params:{
        product_id
    }
})